package com.example.mymvvmdemo.models.main.fragment.device.entity;

import com.google.gson.JsonElement;
import java.util.ArrayList;

public class DeviceShortEntity {

    public int code;
    public String message;
    public DataDTO data;

    @Override
    public String toString() {
        return "DeviceShortEntity{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public DataDTO getData() {
        return data;
    }

    public void setData(DataDTO data) {
        this.data = data;
    }

    public static class DataDTO {
        public String message;
        public ArrayList<ShortcutsDTO> shortcuts;

        @Override
        public String toString() {
            return "DataDTO{" +
                    "message='" + message + '\'' +
                    ", shortcuts=" + shortcuts +
                    '}';
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public ArrayList<ShortcutsDTO> getShortcuts() {
            return shortcuts;
        }

        public void setShortcuts(ArrayList<ShortcutsDTO> shortcuts) {
            this.shortcuts = shortcuts;
        }

        public static class ShortcutsDTO {
            public String id;
            public String icon;
            public String name;
            public String color;

            // ✅ 使用 JsonElement 接收任意结构的 params
            public JsonElement params;

            public String function;


            @Override
            public String toString() {
                return "ShortcutsDTO{" +
                        "id='" + id + '\'' +
                        ", icon='" + icon + '\'' +
                        ", name='" + name + '\'' +
                        ", color='" + color + '\'' +
                        ", params=" + params +  // 自动输出为原始 JSON 字符串
                        ", function='" + function + '\'' +
                        '}';
            }

            public JsonElement getParams() {
                return params;
            }

            public void setParams(JsonElement params) {
                this.params = params;
            }

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getIcon() {
                return icon;
            }

            public void setIcon(String icon) {
                this.icon = icon;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public String getColor() {
                return color;
            }

            public void setColor(String color) {
                this.color = color;
            }

            public String getFunction() {
                return function;
            }

            public void setFunction(String function) {
                this.function = function;
            }
        }
    }
}